﻿<Window x:Class="CmdletHelpEditor.UI.Dialogs.ModuleProperties"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:system="clr-namespace:System;assembly=mscorlib"
        Title="Module Properties"
		SizeToContent="Height"
		Width="500"
		ResizeMode="NoResize"
		ScrollViewer.VerticalScrollBarVisibility="Disabled"
		ShowInTaskbar="False"
		mc:Ignorable="d"
		DataContext="{Binding RelativeSource={RelativeSource Self}}">
	<StackPanel Margin="10">
		<GroupBox Header="General settings">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition/>
				</Grid.RowDefinitions>
				<CheckBox Content="Use support information" IsChecked="{Binding UseSupports}"/>
			</Grid>
		</GroupBox>
		<GroupBox Header="Online publishing provider" VerticalAlignment="Top">
			<StackPanel>
				<CheckBox Content="Use online publishing provider" Command="{Binding UseProviderCommand}" IsChecked="{Binding UseProvider}"/>
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition />
						<RowDefinition />
						<RowDefinition />
						<RowDefinition />
						<RowDefinition />
						<RowDefinition />
						<RowDefinition />
						<RowDefinition />
						<RowDefinition />
						<RowDefinition />
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition />
					</Grid.ColumnDefinitions>
					<TextBlock VerticalAlignment="Center" Text="Provider name: "/>
					<ComboBox x:Name="ProvBox"
							  ItemsSource="{Binding Providers}"
							  SelectedItem="{Binding Mode=TwoWay, Path=ProviderInfo}"
							  SelectionChanged="ProvSelectionChanged"
							  IsEnabled="{Binding UseProvider}"
							  DisplayMemberPath="ProviderName"
							  Grid.Column="1"
							  Grid.Row="0"/>
					<TextBlock Text="Provider URL:" VerticalAlignment="Center" Margin="0,5,0,0" Grid.Column="0" Grid.Row="1"/>
					<TextBox Text="{Binding Path=ProviderInfo.ProviderURL}"
							 Grid.Column="1"
							 Grid.Row="1"
							 Margin="0,5,0,0"
							 IsEnabled="{Binding UrlEditable}"/>
					<TextBlock Text="User name:" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Margin="0,5,0,0"/>
					<TextBox Text="{Binding ProviderInfo.UserName}"
							 IsEnabled="{Binding UserEditable}"
							 Grid.Column="1"
							 Grid.Row="2"
							 Margin="0,5,0,0"/>
					<TextBlock Text="Password:" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" Margin="0,5,0,0"/>
					<PasswordBox x:Name="pwdBox"
								 IsEnabled="{Binding UserEditable}"
								 Grid.Column="1"
								 Grid.Row="3"
								 Margin="0,4,0,0"/>
					<!--<CheckBox Content="Remember password"
									  Grid.Column="1"
									  Grid.Row="4"
									  IsEnabled="{Binding UserEditable}"
									  Margin="-1,2,2,2"/>-->
					<Button Content="Connect"
							Click="ConnectClick"
							IsEnabled="{Binding UserEditable}"
							HorizontalAlignment="Left"
							MinWidth="80"
							Grid.Column="1"
							Grid.Row="5"
							Margin="0,5,0,0"/>
					<TextBlock Grid.Column="0" Grid.Row="6"/>
					<TextBlock Text="Select website:" VerticalAlignment="Center" Grid.Column="0" Grid.Row="7" Margin="0,5,0,0"/>
					<ComboBox ItemsSource="{Binding WebSites}"
							  DisplayMemberPath="blogName"
							  SelectedValue="{Binding Mode=TwoWay, Path=ProviderInfo.Blog}"
							  SelectionChanged="BlogSelectionChanged"
							  IsEnabled="{Binding BlogsLoaded}"
							  Grid.Column="1"
							  Grid.Row="7"/>
					<TextBlock Text="Fetch post count: " VerticalAlignment="Center" Grid.Column="0" Grid.Row="8" Margin="0,5,0,0"/>
					<ComboBox SelectedValuePath="Content"
							  SelectedValue="{Binding ProviderInfo.FetchPostCount}"
							  IsEnabled="{Binding BlogsLoaded}"
							  Grid.Column="1"
							  Grid.Row="8"
							  Margin="0,5,0,0">
						<ComboBoxItem ToolTip="Use application setting">
							<system:Int32>0</system:Int32>
						</ComboBoxItem>
						<ComboBoxItem>
							<system:Int32>10</system:Int32>
						</ComboBoxItem>
						<ComboBoxItem>
							<system:Int32>20</system:Int32>
						</ComboBoxItem>
						<ComboBoxItem>
							<system:Int32>50</system:Int32>
						</ComboBoxItem>
						<ComboBoxItem>
							<system:Int32>100</system:Int32>
						</ComboBoxItem>
						<ComboBoxItem>
							<system:Int32>200</system:Int32>
						</ComboBoxItem>
						<ComboBoxItem>
							<system:Int32>500</system:Int32>
						</ComboBoxItem>
					</ComboBox>
					<Button Content="Fetch now"
							Click="FetchClick"
							MinWidth="80"
							HorizontalAlignment="Left"
							Grid.Column="1"
							Grid.Row="9"
							Margin="0,15,0,0"/>
				</Grid>
			</StackPanel>
		</GroupBox>
		<DockPanel Margin="-10,10,-10,-10" Background="Gainsboro">
			<Button Content="Close"
					Click="CloseClick"
					HorizontalAlignment="Right"
					MinWidth="80"
					DockPanel.Dock="Right"
					Margin="10"/>
			<Button Content="Save"
					Click="SaveClick"
					MinWidth="80"
					DockPanel.Dock="Right"
					HorizontalAlignment="Right"
					Margin="0,10,0,10"/>
		</DockPanel>
	</StackPanel>
</Window>
